// 医生信息
import { getToken, setToken, removeToken } from '@/utils/auth'
import { resetRouter } from '@/router'
import  {_API} from '@/api/bai'

const types = {

    SET_DOCTORINFO : 'SET_DOCTORINFO',
   
}
const state = {
    doctorInfo:[],  
     
}

const mutations = {
 
  [types.SET_DOCTORINFO]:(state, name)=> {
    state.doctorInfo = name
  },
 
}

const actions = {
  // user login
  getRegisterDoctorIndex({ commit }, d){
    return new Promise((resolve, reject) => {
      _API.getRegisterDoctorIndex(d).then((res)=>{
         
            if (res.code === 200 && res.data) {
              commit('SET_DOCTORINFO', res.data.list)
          
              resolve(res)
           
          } else {
              commit('SET_DOCTORINFO', {})
              resolve()
          }
      })
    })
  },
 
 

 
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

